﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace mozhi.smarterp.BasicData.Migrations
{
    public partial class _2025031320 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_CustomerContactItem_MozhiCustomer_CustomerId",
                table: "CustomerContactItem");

            migrationBuilder.DropPrimaryKey(
                name: "PK_CustomerContactItem",
                table: "CustomerContactItem");

            migrationBuilder.RenameTable(
                name: "CustomerContactItem",
                newName: "MozhiCustomerContactItem");

            migrationBuilder.RenameIndex(
                name: "IX_CustomerContactItem_CustomerId",
                table: "MozhiCustomerContactItem",
                newName: "IX_MozhiCustomerContactItem_CustomerId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_MozhiCustomerContactItem",
                table: "MozhiCustomerContactItem",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_MozhiCustomerContactItem_MozhiCustomer_CustomerId",
                table: "MozhiCustomerContactItem",
                column: "CustomerId",
                principalTable: "MozhiCustomer",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_MozhiCustomerContactItem_MozhiCustomer_CustomerId",
                table: "MozhiCustomerContactItem");

            migrationBuilder.DropPrimaryKey(
                name: "PK_MozhiCustomerContactItem",
                table: "MozhiCustomerContactItem");

            migrationBuilder.RenameTable(
                name: "MozhiCustomerContactItem",
                newName: "CustomerContactItem");

            migrationBuilder.RenameIndex(
                name: "IX_MozhiCustomerContactItem_CustomerId",
                table: "CustomerContactItem",
                newName: "IX_CustomerContactItem_CustomerId");

            migrationBuilder.AddPrimaryKey(
                name: "PK_CustomerContactItem",
                table: "CustomerContactItem",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_CustomerContactItem_MozhiCustomer_CustomerId",
                table: "CustomerContactItem",
                column: "CustomerId",
                principalTable: "MozhiCustomer",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
